import React from  'react';
import ReactDOM from 'react-dom';
import {Route, Switch, Redirect} from 'react-router-dom';
import {Provider} from 'react-redux';
import {ConfigProvider} from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import {ConnectedRouter} from 'connected-react-router';
import store from './store/index';
import './assets/css/common.less';

import Tabs from './components/tabs';
import Home from './router/home';
import Mine from './router/mime';
import Profile from './router/profile';
import history from './store/history';

ReactDOM.render(
    <Provider store={store}>
        <ConnectedRouter history={history}>
            <ConfigProvider locale={zhCN}>
                <main className="main-container">
                    <Switch>
                        <Route path="/" exact component={Home}></Route>
                        <Route path="/mine" component={Mine}></Route>
                        <Route path="/home" component={Profile}></Route>
                        <Redirect to="/"></Redirect>
                    </Switch>
                </main>
                <Tabs />
            </ConfigProvider>

        </ConnectedRouter>
    </Provider>
    , document.getElementById('root'));

